Skip to content

ci: allow maintainers to run the module scorecard on fork PRs via /scorecard - #1065

Merged
bpmct merged 4 commits into
mainfrom
bpmct/scorecard-community-prs
Aug 20, 2026
Merged

ci: allow maintainers to run the module scorecard on fork PRs via /scorecard#1065
bpmct merged 4 commits into
mainfrom
bpmct/scorecard-community-prs

Conversation

@bpmct

@bpmct bpmct commented Aug 19, 2026

Copy link
Copy Markdown
Member

Fork PRs currently get no scorecard comment because they don't have access to secrets. This adds an issue_comment trigger: a maintainer comments /scorecard on a community PR to run the check on demand. Same-repo PRs keep the automatic pull_request behavior, unchanged.

The first version of this used pull_request_target, which zizmor rightly blocked. This approach avoids it: issue_comment runs in the base-repo context, the maintainer restriction (OWNER/MEMBER/COLLABORATOR) makes every fork-PR scoring an explicit human decision, and it doubles as cost control for the Anthropic API.

Discussions are not affected. PR mode only reads them for the baseline, and the token only has discussions: read anyway.

To keep secrets safe, the scoring scripts always run from the base repo. PR content is fetched via refs/pull/N/merge and only pulled in under registry/coder/modules/, read as plain text for the prompt, never executed.

🤖 Generated with Coder Agents on behalf of @bpmct

@bpmct
bpmct marked this pull request as ready for review August 19, 2026 21:40
@bpmct bpmct changed the title ci: run module scorecard check on community (fork) PRs ci: allow maintainers to run the module scorecard on fork PRs via /scorecard Aug 20, 2026

@DevelopmentCats DevelopmentCats left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bpmct
bpmct enabled auto-merge (squash) August 20, 2026 17:56
@bpmct
bpmct merged commit 28f30e3 into main Aug 20, 2026
6 checks passed
@bpmct
bpmct deleted the bpmct/scorecard-community-prs branch August 20, 2026 17:57
bpmct added a commit that referenced this pull request Aug 20, 2026
…ks (#1069)

Follow-up to #1065. The `/scorecard` command runs now, but only looks at
`registry/coder/modules`, so community-namespace PRs like #1068 report
"no changed modules" and get no comment.

This makes the PR scorecard check work for modules in any namespace
(`registry/<namespace>/modules/<name>`). Module specs are now
`namespace/name`, with bare names still meaning the coder namespace.

Discussions are still coder-only:

- Community modules skip the baseline lookup and always report a
standalone advisory score, with report text that says so (no "discussion
is created after merge" for them).
- The discussion-writing runs (post-merge, weekly) enumerate
`registry/coder/modules` only, unchanged.
- The script now refuses non-coder specs outside
`--pr-report`/`--dry-run`, so a community discussion can't be created by
accident.

🤖 Generated with Coder Agents on behalf of @bpmct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants